#ifndef EVENT_H_
#define EVENT_H_

#include "SDL/SDL.h"
#include "../common/Constantes.h"
#include "../common/utils/Logger.h"
#include <string>
#include "../common/DTOEvent.h"
#include "../common/DTOCliente.h"
#include "../common/DTOShipStatus.h"
#include "../common/DTOAsteroide.h"
#include "../common/DTOExplosion.h"
#include "../common/DTOShipAction.h"
#include "../common/DTOBonus.h"

enum EventType {
	Quit = SDL_QUIT,
	KeyPressed = SDL_KEYDOWN,
	KeyReleased = SDL_KEYUP,
	MouseButtonPressed = SDL_MOUSEBUTTONDOWN,
	MouseButtonReleased = SDL_MOUSEBUTTONUP,
	UserEvent = SDL_USEREVENT,
	Resize = SDL_VIDEORESIZE,
	MouseMotion = SDL_MOUSEMOTION,
	NewUser = 22,
	Ship_Status = 24,
	UserSyncronize = 25,
	UserDisconected = 26,
	Asteroid_Status = 27,
	New_Explosion = 28,
	Ship_Action = 29,
	New_Bonus = 30,
	UserDisconected_Error = 31,
	ItemList_UpButton = 101,
	ItemList_DownButton = 102
};

enum EventKey {
	Backspace = SDLK_BACKSPACE,
	Space = SDLK_SPACE,
	KeyUp = SDLK_UP,
	KeyLeft = SDLK_LEFT,
	KeyRight = SDLK_RIGHT,
	Delete = SDLK_DELETE,
	Escape = SDLK_ESCAPE,
	Letter_I = SDLK_i,
	Letter_M = SDLK_m

};

enum EventButtonState {
	Pressed = SDL_PRESSED
};

enum EventMouseButton{
	MouseButtonLeft = SDL_BUTTON_LEFT,
	MouseButtonRight = SDL_BUTTON_RIGHT,
	MouseButtonMiddle = SDL_BUTTON_MIDDLE
};

class Event {
public:
	Event(SDL_Event event);

	Event(DTOShipStatus* dtoShip);

	Event(DTOShipAction* dtoShipAction);

	Event(DTOAsteroide* dtoAsteroide);

	Event(DTOExplosion* dtoExplosion);

	Event(DTOEvent* dtoEvent);

	Event(DTOBonus* dtoBonus);

	virtual ~Event();

	virtual void setSender(std::string sender);

	SDL_Event* getEvent();

	virtual EventType getType();

	virtual std::string getTypeDescription();

	virtual EventKey getKey();

	virtual EventButtonState getButtonState();

	virtual EventMouseButton getMouseButton();

	virtual WindowID getCode();

	std::string getData();

	std::string getData2();

	int getintData2();

	virtual Uint16 getKeyUnicode();

	virtual Uint16 getXCoordinate();

	virtual Uint16 getYCoordinate();
	//virtual std::string toString();

	virtual Uint16 getW();

	virtual Uint16 getH();

	DTOEvent* transformInDTO();
	DTOShipStatus* transformInDTOShipStatus();

	std::string getSender();

	void deleteData();
	void deleteData2();

private:
	SDL_Event event;
	std::string sender;

	Event();
};

#endif /* EVENT_H_ */
